<template>
	<view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onLoad(e){

			var self = this;
			var page = e.page;
			
			// self.$request.wx_config();
			if(e.share){
				var share = e.share;
				uni.setStorageSync('share_id',share);
			}
			console.log(e)
			if(e.params){
				console.log('e.params')
				var params = e.params;
				let userdata = JSON.parse(self.$request.decrypt(params));
				uni.setStorageSync('userdata',self.$request.decrypt(params));
			}else{
				console.log('params')
				let userdata = uni.getStorageSync('params');
				console.log(userdata)
				uni.setStorageSync('userdata',userdata);
			}
			
			if(page=='index'){
				uni.switchTab({
				    url: '/pages/index/index'
				});
			}else
			if(page=='shop'){
				uni.switchTab({
				    url: '/pages/shop/shop'
				});
			}else
			if(page=='guaguaka'){
				uni.switchTab({
				    url: '/pages/guaguaka/guaguaka'
				});
			}else
			if(page=='share'){
				uni.switchTab({
				    url: '/pages/share/share'
				});
			}else
			if(page=='custom'){
				uni.reLaunch({
				    url: '../../pagesA/custom/custom'
				});
			}else
			if(page=='custom-detail'){
				uni.reLaunch({
				    url: '../../pagesA/custom-detail/custom-detail?id='+e.id
				});
			}else
			if(page=='custom-detail-brand'){
				uni.reLaunch({
				    url: '../../pagesA/custom-detail-brand/custom-detail-brand?id='+e.id
				});
			}else
			if(page=='person_oreder'){
				uni.reLaunch({
				    url: '../../pagesA/pay/pay?id='+e.id
				});
			}else
			if(page=='good-list'){
				uni.reLaunch({
				    url: '../good-list/good-list?id='+e.id+'&catgray_id='+e.catgray_id+'&style_id='+e.style_id+'&search='+e.search
				});
			}else
			if(page=='local-store-home'){
				uni.reLaunch({
				    url: '../local-store-home/local-store-home?id='+e.id+'&lat='+e.lat+'&lng='+e.lng
				});
			}else
			if(page=='custom-list'){
				uni.reLaunch({
				    url: '../../pagesA/custom-list/custom-list?brand_id='+e.id+'&category_id='+e.category_id
				});
			}else{
				uni.reLaunch({
				    url: '../'+page+'/'+page+'?id='+(e.id ? e.id : 0)
				});
			}
			
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
